/**
 * @license
*
* PreProcessing is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PreProcessing is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PreProcessing.  If not, see <http://www.gnu.org/licenses/>.
* 
*/

package SmartGrid;
/**
 * @file Timer
 * @brief 
 * @description
 */

/**
 * @class 
 */

import java.util.*;
import java.util.Date;
import java.text.SimpleDateFormat;


/**
 *
 * @author Grant
 */
public class Timer {
    
private String _objectName;                 // A string to output
//private;

/**
* Constructs the object, sets the string to be output in function run()
* @param str
*/
public void Task(String objectName) {
this._objectName = objectName;
}

/**
* When the timer executes, this code is run.
*/
public void run() {
// Get current date/time and format it for output
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
String current_time = format.format(date);

// Output to user the name of the objecet and the current time
System.out.println(_objectName + " - Current time: " + current_time);
}
}